﻿
using Dapper;
using System;
using System.Collections.Generic;

namespace hCommand.mySql {
    public class CoreTaskServer :AbsCoreTaskServer, ICoreTaskServer {
        public override List<CoreTask> getfinshTasksforDelete() {


            String sql = "SELECT*  FROM  [Core_task]  where stock_Id=0 and status in(-1,9) and TIMESTAMPDIFF(hour ,Finsh_Time ,now()) > 12 ";
            List<CoreTask> coreTasks = Connection.Query<CoreTask>(sql).AsList();
            return coreTasks;
        }

        public override List<CoreTask> getfinshTasksforBackUp() {
            string sql = "select * from Core_task where upload=1 and TIMESTAMPDIFF(hour ,Finsh_Time ,now()) > 12 ";
            List<CoreTask> coreTasks = Connection.Query<CoreTask>(sql).AsList();
            return coreTasks;
        }
    }
}
